﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/pages/Menu.master" AutoEventWireup="true" CodeFile="Novo.aspx.cs" Inherits="admin_pages_clientes_Novo" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>


<asp:Content ID="Content1" ContentPlaceHolderID="Titulo" Runat="Server">
    Cadastrar Cliente
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Pagina" Runat="Server">
 <asp:ScriptManager ID="ScriptManager1" runat="server" />
    <div class="magin-auto cadastro">
        <fieldset>
            <legend><label>Cliente</label></legend>
                <asp:UpdatePanel runat="server" id="Panel" >
                    <ContentTemplate>
                    <table>
                        <tr>
                            <td>
                                <label>Nome</label>
                            </td>
                            <td>
                                <asp:TextBox ID="txtDescricao" runat="server"></asp:TextBox>
                                 <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                    ControlToValidate="txtDescricao" ErrorMessage="Campo obrigatório!" 
                                    ValidationGroup="cadastrar">
                                </asp:RequiredFieldValidator>
                                <asp:HiddenField ID="hdId" runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <label>
                                URL</label>
                            </td>
                            <td>
                                <asp:TextBox ID="txtUrl" runat="server"></asp:TextBox>
                            </td>
                            <tr>
                                <td>
                                    <label>
                                    Imagem</label>
                                </td>
                                <td>
                                    <asp:asyncfileupload ID="fileUpload" runat="server"
                                                         OnUploadedComplete="UploadedComplete"
                                                         OnUploadedFileError="UploadedFileError"
                                                         ThrobberID="carregando"
                                                         ErrorBackColor="Red"
                                                         >
                                    </asp:asyncfileupload>
                                    <asp:Image ID="img"  runat="server" Width="55px" ImageUrl="~/admin/Images/pimenta.png"/>
                                    <asp:HiddenField ID="hdFoto" runat="server" ClientIDMode="Static"/>
                                </td>
                            </tr>
                            
                            <tr>
                                <td colspan="2">
                                    <asp:Button ID="btnSalvar" runat="server" 
                                        CssClass="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" 
                                        OnClick="Salvar" Text="Salvar" OnClientClick="verificaFoto('hdFoto');" ValidationGroup="cadastrar"/>
                                    
                                </td>
                            </tr>
                        </tr>
                    </table>
                </ContentTemplate>
                    <Triggers>
                    <asp:AsyncPostBackTrigger ControlID = "btnSalvar" EventName ="Click"/>
                </Triggers>
            </asp:UpdatePanel>
            <div class="voltar">
                <asp:LinkButton ID="lkVoltar" runat="server" CssClass="texto_cinza" PostBackUrl="~/admin/pages/clientes/Default.aspx">voltar</asp:LinkButton>
            </div>
        </fieldset>
    </div>
    
</asp:Content>

